﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data.Entity;


namespace CMS.Core
{
    public class CMSContext : DbContext
    {
        /// <summary>
        /// 管理员数据集合
        /// </summary>
        public DbSet<Administrator> Administrators { get; set; }

        /// <summary>
        /// 角色数据集合
        /// </summary>
        public DbSet<Role> Roles { get; set; }

        /// <summary>
        /// 用户数据集合
        /// </summary>
        public DbSet<User> Users { get; set; }

        public CMSContext() : base("Defaultconnection")
        {
            Database.SetInitializer<CMSContext>(new CreateDatabaseIfNotExists<CMSContext>());
        }

    }
}
